import router from '@/router'
import store from '@/store'

export function closeTab(currentPath, targetPath) {
    for (let i in store.state.tagsView.visitedViews) {
        if (store.state.tagsView.visitedViews[i].fullPath == currentPath) {
            store.state.tagsView.visitedViews.splice(store.state.tagsView.visitedViews.indexOf(store.state.tagsView.visitedViews[i]), 1);
        }
    }
    router.push(targetPath);
}